FROM php:7.4.8-fpm
MAINTAINER chuan zenglingchaun@126.com
#替换国内清华大学deb源加速
ADD ./install/sources.list /etc/apt/
ADD ./install/swoole.tgz /tmp/
ADD ./install/redis-5.3.1.tgz /tmp/
#安装扩展
RUN apt-get update && apt-get upgrade && apt-get install -y \
        supervisor \
        cron \
        procps \
        vim \
        zip \
        unzip \
        git \
        apt-utils \
        libwebp-dev \
        libjpeg-dev \
        zlib1g-dev \
        libssl-dev \
        libfreetype6-dev \
        libxslt1-dev \
        libzip-dev \
        libedit-dev \
        libxml2-dev \
        libtidy-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng-dev \
        libicu-dev \
        libxml2-dev \
        libenchant-dev \
    && docker-php-ext-configure gd \
       --with-webp=/usr/include/webp \
       --with-jpeg=/usr/include \
       --with-freetype=/usr/include/freetype2/ \
    && docker-php-ext-install -j$(nproc) gd \
        bcmath \
        calendar \
        dba \
        enchant \
        exif \
        gettext \
        intl \
        mysqli \
        opcache \
        pcntl pdo_mysql \
        shmop \
        soap \
        sockets \
        sysvmsg \
        sysvsem \
        sysvshm \
        tidy \
        xmlrpc \
        xsl \
        zip \
    && cd /tmp/swoole && phpize && ./configure && make && make install \
    && cd /tmp/redis-5.3.1 && phpize && ./configure && make && make install \
    && docker-php-ext-enable swoole redis \
    && curl -sS https://getcomposer.org/installer | php \
    && chmod -R 777 composer.phar && mv composer.phar /usr/local/bin/composer
